package com.example.administrator.himalaya.sqlHelper;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class Helper extends SQLiteOpenHelper {
    public static final String TABLE_NAME = "table_person";
    private static final String DB_NAME = "my_database.db";
    public Helper(Context context){
        super(context, DB_NAME, null, 1);
    }
    @Override
    public void onCreate(SQLiteDatabase db) {
        String sql = "create table if not exists " + TABLE_NAME + "(_id integer primary key autoincrement, title varchar, name varchar ,number varchar)";
        db.execSQL(sql);
        Log.d("123", "onCreate: 数据库创建成功");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
